﻿@namespace MudBlazor
@inherits MudComponentBase

<MudToolBar @attributes="UserAttributes" Class="mud-table-pagination-toolbar" Style="@Style">
    <div class="mud-table-pagination-spacer"></div>
    @if (!DisableRowsPerPage)
    {
        <MudText Typo="Typo.body2" Class="mud-table-pagination-caption">
            @RowsPerPageString
        </MudText>
        <MudSelect T="string" ValueChanged="SetRowsPerPage" Value="@Table?.RowsPerPage.ToString()" Class="mud-table-pagination-select" DisableUnderLine="true" Dense="true">
            @foreach (int pageSize in PageSizeOptions)
            {
                <MudSelectItem T="string" Value="@pageSize.ToString()">@pageSize.ToString().ToUpper()</MudSelectItem>
            }
        </MudSelect>
    }
    <MudText Typo="Typo.body2" Class="mud-table-pagination-caption">
        @Info
    </MudText>
    <div class="mud-table-pagination-actions">
        @if (RightToLeft)
        {
            <MudIconButton Icon="@Icons.Material.Filled.LastPage" @onclick="@(() => Table.NavigateTo(Page.Last))" />
            <MudIconButton Icon="@Icons.Material.Filled.NavigateNext" @onclick="@(() => Table.NavigateTo(Page.Next))" />
            <MudIconButton Icon="@Icons.Material.Filled.NavigateBefore" @onclick="@(() => Table.NavigateTo(Page.Previous))" />
            <MudIconButton Icon="@Icons.Material.Filled.FirstPage" @onclick="@(() => Table.NavigateTo(Page.First))" />
        }
        else
        {
            <MudIconButton Icon="@Icons.Material.Filled.FirstPage" @onclick="@(() => Table.NavigateTo(Page.First))" />
            <MudIconButton Icon="@Icons.Material.Filled.NavigateBefore" @onclick="@(() => Table.NavigateTo(Page.Previous))" />
            <MudIconButton Icon="@Icons.Material.Filled.NavigateNext" @onclick="@(() => Table.NavigateTo(Page.Next))" />
            <MudIconButton Icon="@Icons.Material.Filled.LastPage" @onclick="@(() => Table.NavigateTo(Page.Last))" />
        }
    </div>
</MudToolBar>

